﻿<ResourceDictionary 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts">
    <Style TargetType="vc:Chart">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="vc:Chart">
                    <Grid x:Name="RootElement" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Margin="0,0,0,0" Opacity="{TemplateBinding Opacity}"
                            HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">

                        <Grid x:Name="ShadowGrid" Margin="0,0,0,0" Canvas.ZIndex="0" ></Grid>

                        <Border x:Name="ChartBorder" Padding="{TemplateBinding Padding}" Margin="0,0,0,0" Canvas.ZIndex="1"
                            Background="{TemplateBinding Background}"
                            Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="{TemplateBinding CornerRadius}"
                            BorderBrush="{TemplateBinding BorderBrush}">
                            
                            <Grid x:Name="ChartAreaGrid" Canvas.ZIndex="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>

                                <Rectangle x:Name="ChartLightingBorder" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" Grid.RowSpan="3" Visibility="Collapsed" Margin="0,0,0,0" Canvas.ZIndex="2" StrokeThickness="{TemplateBinding BorderThickness}" >
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#A0FFFFFF" Offset="0"/>
                                            <GradientStop Color="#00FFFFFF" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>

                                <StackPanel x:Name="TopOuterPanel" Grid.Row="0" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Canvas.ZIndex="4">
                                    <StackPanel x:Name="TopOuterTitlePanel" HorizontalAlignment="Stretch" ></StackPanel>
                                    <StackPanel x:Name="TopOuterLegendPanel" HorizontalAlignment="Stretch" ></StackPanel>
                                </StackPanel>

                                <StackPanel Name="BottomOuterPanel" Grid.Row="2" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Canvas.ZIndex="4">
                                    <StackPanel x:Name="BottomOuterLegendPanel" ></StackPanel>
                                    <StackPanel x:Name="BottomOuterTitlePanel" ></StackPanel>
                                </StackPanel>

                                <StackPanel x:Name="LeftOuterPanel" Grid.Row="1" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Stretch" Canvas.ZIndex="4">
                                    <StackPanel x:Name="LeftOuterTitlePanel" Orientation="Horizontal" ></StackPanel>
                                    <StackPanel x:Name="LeftOuterLegendPanel" Orientation="Horizontal" ></StackPanel>
                                </StackPanel>

                                <StackPanel x:Name="RightOuterPanel" Grid.Row="1" Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Stretch" Canvas.ZIndex="4">
                                    <StackPanel x:Name="RightOuterLegendPanel" Orientation="Horizontal" ></StackPanel>
                                    <StackPanel x:Name="RightOuterTitlePanel" Orientation="Horizontal" ></StackPanel>
                                </StackPanel>
                                
                                <!-- Margin="{TemplateBinding Padding}" -->
                                
                                <Grid x:Name="CenterOuterGrid" Margin="0" Grid.Row="1" Grid.Column="1" Canvas.ZIndex="3" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>

                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>

                                    <Grid x:Name="TopOffsetGrid" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Stretch"/>
                                    <Grid x:Name="BottomOffsetGrid" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Stretch"/>
                                    <Grid x:Name="LeftOffsetGrid" Grid.Row="0" Grid.Column="0" Grid.RowSpan="3" VerticalAlignment="Stretch"/>
                                    <Grid x:Name="RightOffsetGrid" Grid.Row="0" Grid.Column="2" Grid.RowSpan="3" VerticalAlignment="Stretch"/>

                                    <Grid x:Name="CenterGrid" Grid.Row="1" Margin="0" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>

                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>

                                        <Grid x:Name="TopAxisGrid" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Stretch">
                                            <StackPanel x:Name="TopAxisContainer" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                                <StackPanel x:Name="TopAxisPanel"></StackPanel>
                                                <ScrollBar x:Name="TopAxisScrollBar" Orientation="Horizontal" Visibility="Collapsed"></ScrollBar>
                                            </StackPanel>
                                        </Grid>

                                        <Grid x:Name="LeftAxisGrid" Grid.Row="1" Grid.RowSpan="2" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                            <StackPanel x:Name="LeftAxisContainer" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                                <StackPanel x:Name="LeftAxisPanel"></StackPanel>
                                                <ScrollBar x:Name="LeftAxisScrollBar" Height="1" VerticalAlignment="Top" Orientation="Vertical" Visibility="Collapsed"></ScrollBar>
                                            </StackPanel>
                                        </Grid>

                                        <Grid x:Name="RightAxisGrid" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                            <StackPanel x:Name="RightAxisContainer" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                                <ScrollBar x:Name="RightAxisScrollBar" VerticalAlignment="Top" Height="0" Orientation="Vertical" Visibility="Collapsed" ></ScrollBar>
                                                <StackPanel x:Name="RightAxisPanel" ></StackPanel>
                                            </StackPanel>
                                        </Grid>

                                        <Grid x:Name="BottomAxisGrid" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Stretch">
                                            <StackPanel x:Name="BottomAxisContainer" Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                                <ScrollBar x:Name="BottomAxisScrollBar" Height="10" Orientation="Horizontal" Visibility="Collapsed" ></ScrollBar>
                                                <StackPanel x:Name="BottomAxisPanel" ></StackPanel>
                                            </StackPanel>
                                        </Grid>

                                        <Grid x:Name="CenterInnerGrid" Margin="0" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

                                            <Canvas x:Name="PlotAreaShadowCanvas" Canvas.ZIndex="0" Margin="0,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"></Canvas>
                                            <!-- Margin="0,0,4,4" -->
                                            <Grid x:Name="PlotAreaGrid" Canvas.ZIndex="0" Margin="0,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                                <ScrollViewer BorderThickness="0" IsTabStop="False" x:Name="PlotAreaScrollViewer" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" Padding="0">
                                                    <Canvas x:Name="PlotCanvas">
                                                        
                                                        <Canvas x:Name="DrawingCanvas" Canvas.ZIndex="1" Margin="0,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"></Canvas>
                                                        
                                                        <!-- <Canvas x:Name="PlotAreaBevelCanvas" Canvas.ZIndex="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"></Canvas>-->
                                                        
                                                    </Canvas>
                                                </ScrollViewer>
                                            </Grid>
                                            
                                            <Grid x:Name="InnerGrid" Canvas.ZIndex="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="Auto"/>
                                                    <ColumnDefinition/>
                                                    <ColumnDefinition Width="Auto"/>
                                                </Grid.ColumnDefinitions>

                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="Auto"/>
                                                    <RowDefinition/>
                                                    <RowDefinition Height="Auto"/>
                                                </Grid.RowDefinitions>

                                                <StackPanel Name="TopInnerPanel" Grid.Row="0" Grid.ColumnSpan="3">
                                                    <StackPanel x:Name="TopInnerTitlePanel" ></StackPanel>
                                                    <StackPanel x:Name="TopInnerLegendPanel" ></StackPanel>
                                                </StackPanel>

                                                <StackPanel Name="BottomInnerPanel" Grid.Row="2" Grid.ColumnSpan="3">
                                                    <StackPanel x:Name="BottomInnerLegendPanel" ></StackPanel>
                                                    <StackPanel x:Name="BottomInnerTitlePanel" ></StackPanel>
                                                </StackPanel>

                                                <StackPanel x:Name="LeftInnerPanel" Grid.Column="0" Grid.Row="1" Orientation="Horizontal" >
                                                    <StackPanel x:Name="LeftInnerTitlePanel" Orientation="Horizontal" ></StackPanel>
                                                    <StackPanel x:Name="LeftInnerLegendPanel" Orientation="Horizontal" ></StackPanel>
                                                </StackPanel>

                                                <StackPanel x:Name="RightInnerPanel" Grid.Column="2" Grid.Row="1" Orientation="Horizontal" >
                                                    <StackPanel x:Name="RightInnerLegendPanel" Orientation="Horizontal" ></StackPanel>
                                                    <StackPanel x:Name="RightInnerTitlePanel" Orientation="Horizontal" ></StackPanel>
                                                </StackPanel>
                                            </Grid>
                                        </Grid>

                                    </Grid>
                                </Grid>

                            </Grid>
                        </Border>
                        <Canvas x:Name="BevelCanvas" Canvas.ZIndex="2" Margin="0,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ></Canvas>
                        <StackPanel x:Name="CenterDockInsidePlotAreaPanel" Canvas.ZIndex="3" HorizontalAlignment="Center" VerticalAlignment="Center" ></StackPanel>
                        <StackPanel x:Name="CenterDockOutsidePlotAreaPanel" Canvas.ZIndex="4" HorizontalAlignment="Center" VerticalAlignment="Center" ></StackPanel>
                        <Canvas x:Name="ToolTipCanvas" Canvas.ZIndex="5" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" >
                        </Canvas>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="Padding" Value="0"/>
        <Setter Property="AnimationEnabled" Value="true"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Black"/>
        <Setter Property="BorderThickness" Value="0.5"/>
        <Setter Property="ToolTipEnabled" Value="true"/>
        <Setter Property="ColorSet" Value="Visifire1"/>
        <Setter Property="Theme" Value="Theme1"/>
    </Style>

    <Style TargetType="vc:DataSeries">
        <Setter Property="Bevel" Value="true"/>
        <Setter Property="LightingEnabled" Value="true"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderColor" Value="Black"/>
    </Style>

    <Style TargetType="vc:ToolTip">
        <Setter Property="IsHitTestVisible" Value="False"/>
        <Setter Property="Visibility" Value="Collapsed"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="CornerRadius" Value="4,4,4,4"/>
        <Setter Property="BorderThickness" Value="0.25,0.25,0.25,1"/>
        <Setter Property="BorderBrush" Value="#FF000000"/>
        <Setter Property="Padding" Value="10,5,10,3"/>
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush Opacity="0.9" EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFC8C8C4" Offset="0.156"/>
                    <GradientStop Color="#F0FFFFFF" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="FontFamily" Value="Portable User Interface"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="FontColor" Value="#FF2E2D2D"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="vc:ToolTip" >
                    <Border  Name="ToolTipBorder" IsHitTestVisible="false" Visibility="{TemplateBinding Visibility}" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"  Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}">
                        <Border.Child>
                            <TextBlock Name="ToolTipTextBlock" LineHeight="{TemplateBinding FontSize}" LineStackingStrategy="BlockLineHeight" TextWrapping="Wrap" Text="{TemplateBinding Text}" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding FontColor}" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}"/>
                        </Border.Child>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="vc:DataPoint">

    </Style>

    <Style TargetType="vc:Title">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="vc:Title" >
                    <Canvas Margin="0,0,0,0" ></Canvas>
                </ControlTemplate>
            </Setter.Value>

        </Setter>
        <Setter Property="Enabled" Value="True"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="FontFamily" Value="Verdana"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
    </Style>

    <Style TargetType="vc:Axis">
        <Setter Property="LineThickness" Value="0.5" />
        <Setter Property="LineColor" Value="Gray" />
        <Setter Property="TitleFontFamily" Value="Verdana"/>
    </Style>

    <Style TargetType="vc:PlotArea">
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderColor" Value="Gray"/>
        <!--<Setter Property="Color" Value="Transparent"/>-->
    </Style>

    <Style TargetType="vc:ChartGrid">
        <Setter Property="LineThickness" Value="0.25"/>
        <Setter Property="LineStyle" Value="Solid"/>
        <Setter Property="LineColor" Value="Gray"/>
    </Style>

    <Style TargetType="vc:AxisLabels">
        <Setter Property="FontSize" Value="10"/>
        <Setter Property="FontFamily" Value="Verdana"/>
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <!--<Setter Property="Rows" Value="0"/>-->
    </Style>

    <Style TargetType="vc:Ticks">
        <Setter Property="LineColor" Value="Gray"/>
        <Setter Property="LineThickness" Value="0.5"/>
        <Setter Property="LineStyle" Value="Solid"/>
        <Setter Property="Enabled" Value="true"/>
    </Style>

    <Style TargetType="vc:Legend">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Padding" Value="4"/>
        <Setter Property="EntryMargin" Value="3"/>
        <Setter Property="LabelMargin" Value="6"/>
        <Setter Property="FontFamily" Value="Arial"/>
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="FontSize" Value="9"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderColor" Value="Black"/>
        <Setter Property="CornerRadius" Value="1"/>
        <Setter Property="Enabled" Value="true"/>
        <Setter Property="LightingEnabled" Value="true"/>
        <Setter Property="TitleFontSize" Value="10"/>
        <Setter Property="TitleBackground" Value="LightGray"/>
        <Setter Property="TitleAlignmentX" Value="Stretch"/>
        <Setter Property="TitleTextAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Bottom"/>
    </Style>

</ResourceDictionary>
